from redis import StrictRedis

class Config(object):
    DEBUG=None
    SECRET_KEY = 'ASDJKAHJKH2KH3K2J3H2KJDS3XX'

    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info14'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # 配置redis连接信息
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)  # session连接的redis数据库实例
    SESSION_USE_SIGNER = True  # session签名
    PERMANENT_SESSION_LIFETIME = 86400  # session有效期

class DevelopmentConfig(Config):
    DEBUG = True


# 实现生产模式下的配置信息
class ProductionConfig(Config):
    DEBUG = False

config_dict = {
    'development':DevelopmentConfig,
    'production':ProductionConfig
}
